"""
利用Python进行数据分析

读写文本格式的数据

pandas
"""
import numpy as np
from pandas import Series, DataFrame
import pandas as pd


def read_test_01():
    """
    将数据写出到文本格式
    :return:
    """
    # data = pd.read_csv('ex5.csv')
    # data.to_csv('out.csv')
    # data.to_csv('out.csv', sep='|')
    # data.to_csv('out.csv', na_rep='NULL')
    # data.to_csv('out.csv', na_rep='NULL', index=False, header=False)
    # data.to_csv('out.csv', na_rep='NULL', index=False, columns=['a', 'b', 'c'])

    # dates = pd.date_range('1/1/2000', periods=7)
    # # print(dates)
    # ts = Series(np.arange(7), index=dates)
    # # print(ts)
    # ts.to_csv('tseries.csv', header=False)

    ts = Series.from_csv('tseries.csv', parse_dates=True)
    print(ts)


def main():
    read_test_01()


if __name__ == '__main__':
    main()
